/**
 * Copyright 2008 Matthew DeLambo
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.delambo.drool.utilities;

import java.util.*;

/**
 * Static map which contains detailed error messages which can be retrieved by
 * sending a keyword to the get function.
 * @author delambo
 */
public class Error_Msg {
    private final static HashMap<String, Integer> error_map =
            new HashMap<String, Integer>();
    private final static String newline = System.getProperty("line.separator");
    
    static {
        error_map.put("timeout", 0);
        error_map.put("clean", 1);
        error_map.put("", 2);
        error_map.put("", 3);
        error_map.put("", 4);
        error_map.put("", 5);
    }
    
    public static String get(String error_msg) {
        switch(error_map.get(error_msg)) {
            case 0:
                return "The current thread, while waiting for a connection, " +
               "was interrupted, or, most " + newline + "likely, timed-out " +
               "while waiting for a connection in the pool to become " +
               "available." + newline + "The following is a state of the " +
               "pool; either the connection timeout may need to" + newline + 
               "be increased, or connections are not being returned properly " +
               "to the pool: ";
            case 1:
                return "";
            case 2:
                return "";
            case 3:
                return "";
            case 4:
                return "";
            case 5:
                return "";
        }
        return "";
    }
}
